package com.fa.wisdom.common;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.util.Log;

import androidx.multidex.MultiDex;

import com.baidu.mapapi.CoordType;
import com.baidu.mapapi.SDKInitializer;
import com.coder.zzq.smartshow.core.SmartShow;
import com.tencent.mmkv.MMKV;
import com.tuya.appsdk.sample.device.config.util.sp.SpUtils;
import com.tuya.smart.android.demo.camera.CameraUtils;
import com.tuya.smart.home.sdk.TuyaHomeSdk;
import com.uuzuche.lib_zxing.activity.ZXingLibrary;

import java.util.HashMap;

/**
 * create by steven
 * 2021-06-24
 * <p>
 * des:
 */
public class App extends Application {
    @SuppressLint("StaticFieldLeak")
    private static Context mContext;
    @Override
    public void onCreate() {
        super.onCreate();
        mContext = this;
        SmartShow.init(this);
        initPlugin();
    }

    public static Context getContext() {
        return mContext;
    }
    /**
     * 初始化x5内核
     */
    /**
     * 初始化插件
     */
    private void initPlugin() {
        MMKV.initialize(this);//初始化mv
        TuyaHomeSdk.init(this);
        TuyaHomeSdk.setDebugMode(true);
        SpUtils.getInstance().initSp(this);
        ZXingLibrary.initDisplayOpinion(this);
        CameraUtils.init(this);
        SDKInitializer.initialize(getApplicationContext());
        //在使用SDK各组件之前初始化context信息，传入ApplicationContext
    }
    @Override
    protected void attachBaseContext(android.content.Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}
